﻿// -----------------------------------------------------------------------
// <copyright file="FrontEndDeveloperBase.cs" company="SoftServe">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace SoftServe.HrManager.Models
{
    using System;

    using SoftServe.HrManager.Abstractions;
    using System.Collections.Generic;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public abstract class FrontEndDeveloperBase : IDeveloper
    {
        public const string DefaultName = "Default front-end name";

        public FrontEndDeveloperBase()
        {
            Name = DefaultName;
        }
        
        protected FrontEndDeveloperBase(string name)
        {
            Name = name;
        }

        #region IDeveloper implementation

        public string Name { get; set; }

        public void WriteCode()
        {
            WriteMarkupCode();
        }

        public IEnumerable<eSkillName> Skills { get; set; }

        #endregion


        #region IEquatable<IDeveloper> implementation

        public bool Equals(IDeveloper other)
        {
            if (other != null)
            {
                return string.Compare(other.Name, Name, true) == 0
                    & other.GetType().IsAssignableFrom(typeof(FrontEndDeveloperBase));
            }
            return false;
        }

        #endregion

        public abstract void WriteMVCCode();
        public abstract void WriteMarkupCode();
    }
}
